
***************************************************
* Figure B.1
***************************************************


use "$workdat_abj/combine/combine_select_con_2000", clear /* see $data_do/baseline.do */
forvalues year=2001/2006 {
append using "$workdat_abj/combine/combine_select_con_`year'" /* see $data_do/baseline.do */
keep pnr age ie_type edul eduf fm_markl fm_markf d_childl d_childf civstl civstf foed_dagl year month week
}

capture drop age_q
g age_q=floor( (age-floor(age))*12)*(1/12) + floor(age)
keep if age_q>=20 & age_q<30
g e=1
replace month=12 if month==0

keep if ie_type==1
keep if eduf=="10"
capture drop tjek_fm_mark tjek_d_child tjek_civst 
g tjek_fm_mark=fm_markl!=6 | fm_markf!=6 
g tjek_d_child=d_childl!=0 | d_childf!=0 
g tjek_civst  =civstl!="U" | civstf!="U" 
capture drop tjek_all
g tjek_all  =  tjek_fm_mark==1 | tjek_d_child==1 | tjek_civst==1

preserve
collapse tjek_fm_mark tjek_d_child tjek_civst tjek_all (sum) e if age_q>=21 & age_q<29, by(pnr age_q)
g z=1
collapse tjek_fm_mark tjek_d_child tjek_civst tjek_all (sum) z [aw=e] if age_q>=21 & age_q<29, by(age_q)
twoway (scatter tjek_fm_mark age_q, msize(medsmall) msymbol(triangle) mlcolor(gs1) mfcolor(gs14)) ///
       (scatter tjek_d_child age_q, msize(small) msymbol(square) mlcolor(gs1) mfcolor(gs14)) ///
       (scatter tjek_civst age_q,   msize(medsmall) msymbol(o) mlcolor(gs1) mfcolor(gs16)) ///
       (scatter tjek_all age_q,     msize(medium) msymbol(o) mlcolor(gs1) mfcolor(gs14))   ///
	   , scheme(s1mono) xline(24.95833, lcolor(gs8) lwidth(medthin) lpattern(shortdash)) xlabel(21(1)29) ylabel(0(0.1)1) ///
	     xtitle("Age in months", height(5)) ytitle("Share fulfilling exclusion criteria", height(5))  /// 
		 legend(order(1 "Lives w. parents" 2 "Has children" 3 "Married" 4 "Any")) ///
		 name(figB1, replace)

graph save figB1  $figures/figB1, replace
graph export $figures/figB1.pdf, name(figB1) replace
graph export $figures/figB1.png, name(figB1) replace

restore
***************************************************
* end: Figure B.1
***************************************************

